package edu.zut.main.thread;

public class ThreadDemo3 {

    public static void main(String[] args) {
        //利用匿名内部类创建线程
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName() + " begin......");
            }
        },"线程A");

        //利用lambda表达式创建
        new Thread(() -> {
            System.out.println(Thread.currentThread().getName() + " begin......");
        },"线程B").start();

        thread.start();
    }

}
